package com.eachonline.smart.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eachonline.core.Pagination;
import com.eachonline.mapper.GenericMapper;
import com.eachonline.service.GenericServiceImpl;
import com.eachonline.smart.mapper.SmartBannerMapper;
import com.eachonline.smart.model.SmartBanner;
import com.eachonline.smart.model.SmartBannerExample;
import com.eachonline.smart.service.BannerService;
import com.eachonline.util.StringUtil;
@Service
public class BannerServiceImp extends GenericServiceImpl<SmartBanner, SmartBannerExample, String> implements BannerService {

	@Autowired
	private SmartBannerMapper  smartBannerMapper;

	@Override
	protected GenericMapper<SmartBanner, SmartBannerExample, String> getGenericMapper() {
		// TODO Auto-generated method stub
		return this.smartBannerMapper;
	}

	@Override
	public Pagination<SmartBanner>  queryBannerList(int start, int pageSize,
			String site) {
		// TODO Auto-generated method stub
		SmartBannerExample bannerExample=new SmartBannerExample();
		if(StringUtil.isNotEmpty(site))
		{
			bannerExample.createCriteria().andSiteEqualTo(site);
		}
	
		Pagination<SmartBanner>  pageInfo= queryByPage(bannerExample, start, pageSize);
		return  pageInfo;
	}

	
	
	
}